﻿@model IEnumerable<LyyCMS.Core.Models.Site>

@{
    ViewData["Title"] = "Index";
}

<div style="margin:0px 10px; padding:20px 0">
    <a asp-action="Create">
        <i class="fas fa-pencil-alt">
        </i>新建
    </a>
</div>

<div class="card">
    <div class="card-header">
        <h3 class="card-title">站点管理</h3>

        <div class="card-tools">
            <button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
                <i class="fas fa-minus"></i>
            </button>
        </div>
    </div>
    <div class="card-body p-0">
        <table class="table table-striped projects">
            <thead>
                <tr>
                    <th style="width: 1%">
                        #
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.SiteName)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.SiteType)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.IsEnabled)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.IsDefault)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.SortId)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Name)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Logo)
                    </th>
                    <th style="width: 20%">
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                <tr>
                    <td>
                        #
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.SiteName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.SiteType)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.IsEnabled)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.IsDefault)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.SortId)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Logo)
                    </td>                    
                    <td class="project-actions text-right">
                        <a class="btn btn-primary btn-sm" asp-action="Details" asp-route-id="@item.Id">
                            <i class="fas fa-folder">
                            </i>
                            看
                        </a>
                        <a class="btn btn-info btn-sm" asp-action="Edit" asp-route-id="@item.Id">
                            <i class="fas fa-pencil-alt">
                            </i>
                            改
                        </a>
                        <a class="btn btn-danger btn-sm" asp-action="Delete" asp-route-id="@item.Id">
                            <i class="fas fa-trash">
                            </i>
                            删
                        </a>
                    </td>
                </tr>
                }
            </tbody>
        </table>
    </div>
    <!-- /.card-body -->
</div>

<table class="table" style="display:none;">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.SiteName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SiteType)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsEnabled)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsDefault)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SortId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Logo)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CompanyAddress)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Phone)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Tex)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Email)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Record)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CopyRight)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreationTime)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreatorUserId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.LastModifierUserId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.LastModificationTime)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.SiteName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SiteType)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.IsEnabled)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.IsDefault)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SortId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Logo)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CompanyAddress)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Phone)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Tex)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Record)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CopyRight)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreationTime)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreatorUserId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.LastModifierUserId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.LastModificationTime)
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.Id">修</a> |
                    <a asp-action="Details" asp-route-id="@item.Id">看</a> |
                    <a asp-action="Delete" asp-route-id="@item.Id">删</a>
                </td>
            </tr>
        }
    </tbody>
</table>
